package com.xiguaji.tiktok.v1.ins.dic.repository;

import com.xiguaji.tiktok.v1.ins.dic.model.InsDicNation;
import org.springframework.data.jdbc.repository.query.Query;
import org.springframework.data.repository.CrudRepository;

import java.util.List;

public interface InsDicNationRepository extends CrudRepository<InsDicNation,Long> {

    List<InsDicNation> findAllByOrderByName();

    List<InsDicNation> findByTypeOrderByName(int type);

    @Query("select code from ins_dic_nation where name = :name")
    String findCodeByName(String name);
}
